package com.rocbrid.vo.req;


import com.rocbrid.annotation.ValidState;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;

@Data
public class ArticleAddVo {
    @NotNull(message = "文章标题不能为空")
    private String title;//文章标题
    @NotNull(message = "文章内容不能为空")
    private String content;//文章内容
    @NotBlank(message = "URL 地址不能为空")
    @Pattern(regexp = "^(http|https)://([\\w-]+\\.)+[\\w-]+(/[\\w-./?%&=]*)?$",
            message = "URL 格式不合法，需以 http:// 或 https:// 开头")
    private String coverImg;//封面图像
    @ValidState
    private String state;//发布状态 已发布|草稿
    private Integer categoryId;//文章分类id
    private Integer createUser;//创建人ID
}
